--------------------------------------------------------
--  File created - Wednesday-December-07-2011   
--------------------------------------------------------
  DROP TABLE "CAREGIVER" cascade constraints;
  DROP TABLE "CASEWORKER" cascade constraints;
  DROP TABLE "CLIENT" cascade constraints;
  DROP TABLE "CLIENTCONTACT" cascade constraints;
  DROP TABLE "CREDENTIAL" cascade constraints;
  DROP TABLE "INSURANCE" cascade constraints;
  DROP TABLE "INSURED" cascade constraints;
  DROP TABLE "INVOICE" cascade constraints;
  DROP TABLE "PAYMENT" cascade constraints;
  DROP TABLE "SCHEDULEDVISIT" cascade constraints;
  DROP TABLE "STAFFCONTACT" cascade constraints;
  DROP TABLE "STAFFCREDENTIAL" cascade constraints;
  DROP SEQUENCE "CAREGIVER_SEQ";
  DROP SEQUENCE "CAREGIVER_SEQ1";
  DROP SEQUENCE "CASEWORKER_SEQ1";
  DROP SEQUENCE "INVOICENO_LOOKUP_SEQ";
  DROP SEQUENCE "INVOICE_SEQ";
  DROP SEQUENCE "INVOICE_SEQ1";
--------------------------------------------------------
--  DDL for Sequence CAREGIVER_SEQ
--------------------------------------------------------

   CREATE SEQUENCE  "CAREGIVER_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence CAREGIVER_SEQ1
--------------------------------------------------------

   CREATE SEQUENCE  "CAREGIVER_SEQ1"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1060 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence CASEWORKER_SEQ1
--------------------------------------------------------

   CREATE SEQUENCE  "CASEWORKER_SEQ1"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 2040 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence INVOICENO_LOOKUP_SEQ
--------------------------------------------------------

   CREATE SEQUENCE  "INVOICENO_LOOKUP_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence INVOICE_SEQ
--------------------------------------------------------

   CREATE SEQUENCE  "INVOICE_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence INVOICE_SEQ1
--------------------------------------------------------

   CREATE SEQUENCE  "INVOICE_SEQ1"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 3040 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Table CAREGIVER
--------------------------------------------------------

  CREATE TABLE "CAREGIVER" 
   (	"CAREGIVERID" NUMBER, 
	"FIRSTNAME" VARCHAR2(100), 
	"MIDDLEINIT" CHAR(1), 
	"LASTNAME" VARCHAR2(100), 
	"STREET" VARCHAR2(100), 
	"CITY" VARCHAR2(100), 
	"STATE" VARCHAR2(100), 
	"SEX" CHAR(1), 
	"EMAIL" VARCHAR2(100), 
	"DATEOFBIRTH" DATE, 
	"PHONE" VARCHAR2(100), 
	"ZIPCODE" VARCHAR2(100), 
	"HOURLYPAYRATE" NUMBER(6,2)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table CASEWORKER
--------------------------------------------------------

  CREATE TABLE "CASEWORKER" 
   (	"CASEWORKERID" NUMBER, 
	"FIRSTNAME" VARCHAR2(100), 
	"MIDDLEINIT" CHAR(1), 
	"LASTNAME" VARCHAR2(100), 
	"STREET" VARCHAR2(100), 
	"CITY" VARCHAR2(100), 
	"STATE" VARCHAR2(100), 
	"SEX" CHAR(1), 
	"PHONE" VARCHAR2(20), 
	"ZIPCODE" VARCHAR2(100), 
	"NAMEOFINSURER" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table CLIENT
--------------------------------------------------------

  CREATE TABLE "CLIENT" 
   (	"CLIENTSSN" VARCHAR2(9), 
	"FIRSTNAME" VARCHAR2(100), 
	"MIDDLEINIT" CHAR(1), 
	"LASTNAME" VARCHAR2(100), 
	"STREET" VARCHAR2(100), 
	"CITY" VARCHAR2(100), 
	"STATE" VARCHAR2(100), 
	"PHONE" VARCHAR2(100), 
	"SEX" CHAR(1), 
	"EMAIL" VARCHAR2(100), 
	"ZIPCODE" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table CLIENTCONTACT
--------------------------------------------------------

  CREATE TABLE "CLIENTCONTACT" 
   (	"CLIENTSSN" VARCHAR2(9), 
	"FIRSTNAME" VARCHAR2(100), 
	"LASTNAME" VARCHAR2(100), 
	"STREET" VARCHAR2(100), 
	"CITY" VARCHAR2(100), 
	"CONTACTSEX" CHAR(1), 
	"PHONE" VARCHAR2(100), 
	"RELATIONSHIP" VARCHAR2(100), 
	"ZIPCODE" VARCHAR2(100), 
	"STATE" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table CREDENTIAL
--------------------------------------------------------

  CREATE TABLE "CREDENTIAL" 
   (	"CREDENTIALTYPE" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table INSURANCE
--------------------------------------------------------

  CREATE TABLE "INSURANCE" 
   (	"NAMEOFINSURER" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table INSURED
--------------------------------------------------------

  CREATE TABLE "INSURED" 
   (	"CLIENTSSN" VARCHAR2(9), 
	"CASEWORKERID" NUMBER, 
	"INSURANCENUMBER" VARCHAR2(100), 
	"ISPRIMARY" CHAR(1), 
	"HOURLYBILLRATE" NUMBER(6,2)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table INVOICE
--------------------------------------------------------

  CREATE TABLE "INVOICE" 
   (	"INVOICENUMBER" NUMBER(15,0), 
	"DOLLARAMOUNT" NUMBER(10,2), 
	"INVOICEDATE" DATE, 
	"CLIENTSSN" VARCHAR2(9), 
	"CASEWORKERID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table PAYMENT
--------------------------------------------------------

  CREATE TABLE "PAYMENT" 
   (	"INVOICENUMBER" NUMBER, 
	"PAYMENTAMOUNT" NUMBER(10,2), 
	"PAYMENTDATE" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table SCHEDULEDVISIT
--------------------------------------------------------

  CREATE TABLE "SCHEDULEDVISIT" 
   (	"CLIENTSSN" VARCHAR2(9), 
	"DATEOFVISIT" DATE, 
	"CAREGIVERID" NUMBER, 
	"TYPEOFCARE" VARCHAR2(100), 
	"TIMESTARTED" DATE, 
	"TIMEENDED" DATE, 
	"INVOICENUMBER" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table STAFFCONTACT
--------------------------------------------------------

  CREATE TABLE "STAFFCONTACT" 
   (	"CAREGIVERID" NUMBER, 
	"FIRSTNAME" VARCHAR2(100), 
	"LASTNAME" VARCHAR2(100), 
	"MIDDLEINIT" CHAR(1), 
	"STREET" VARCHAR2(100), 
	"CITY" VARCHAR2(100), 
	"CONTACTSTATE" VARCHAR2(100), 
	"PHONE" NUMBER(30,0), 
	"SEX" CHAR(1), 
	"ZIPCODE" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Table STAFFCREDENTIAL
--------------------------------------------------------

  CREATE TABLE "STAFFCREDENTIAL" 
   (	"CAREGIVERID" NUMBER, 
	"EXPIRATIONDATE" DATE, 
	"IDENTIFICATIONNUMBER" VARCHAR2(100), 
	"CREDENTIALTYPE" VARCHAR2(100)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
REM INSERTING into CAREGIVER
SET DEFINE OFF;
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1000,'Doug','J','Keeley','1000 Fleet St','Baltimore','MD','M','doug@doug.com',to_date('29-JAN-45','DD-MON-RR'),'410-555-1212','21202',200);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1020,'John','E','Doe','6610 Vincent Lane','Columbia','Maryland','M','john.doe@aol.com',to_date('10-OCT-65','DD-MON-RR'),'410-123-0987','21345',34.75);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1040,'Felecia','T','Jones','512 Allendale Drive','Providence','Rhode Island','F','feleflo20@aol.com',to_date('20-JUL-76','DD-MON-RR'),'401-887-2339','02804',25.5);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1041,'Joshua','G','Hughes','1001 Ashburton Avenue','Baltimore','Maryland','M','toogood4you@yahoo.com',to_date('18-DEC-60','DD-MON-RR'),'443-982-0010','21213',20);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1042,'Alicia','A','Allen','34 Moravia Road','Alexandria','Virginia','F','aliciaallen@hotmail.com',to_date('12-AUG-80','DD-MON-RR'),'704-776-7771','22301',30.8);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1043,'Alloysius','B','Pager','11 Norman drive','Manassas','Virginia','M','alloy2010pager@yahoo.com',to_date('03-JUN-83','DD-MON-RR'),'202-765-0098','20110',25.5);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1044,'Mary','N','Flowers','678 Montgomery drive','Newark','Delaware','F','mary.nancy.flowers66@gmail.com',to_date('18-FEB-66','DD-MON-RR'),'302-490-1776','19702',40);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1045,'Jordan','A','Parker','2 Locust ct, Apt.4A','Bear','Delaware','F','parker2008@yahoo.com',to_date('10-JUL-75','DD-MON-RR'),'302-231-8245','19701',30);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1046,'Kricia','S','Keenan','890 King Solomon road','Baltimore','Maryland','F','kksavannah01@hotmail.com',to_date('30-NOV-87','DD-MON-RR'),'443-869-4533','21213',30.8);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1047,'Corletha','D','Johnson','54 Philadelphia Avenue','St.Cloud','Minnesota','F','djohnson78@yahoo.com',to_date('17-JAN-78','DD-MON-RR'),'651-222-8234','55144',45.5);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1048,'Dorothy','J','Blade','2 Locust ct, Apt.2B','Bear','Delaware','F','dorothy.B@gmail.com',to_date('13-MAR-79','DD-MON-RR'),'301-451-2990','19701',50);
Insert into CAREGIVER (CAREGIVERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,EMAIL,DATEOFBIRTH,PHONE,ZIPCODE,HOURLYPAYRATE) values (1049,'Luke','R','Gardiner','701 Avery Drive','Chicago','Illinois','M','lukeralphg8t@hotmail.com',to_date('28-OCT-70','DD-MON-RR'),'312-334-8181','60629',20.5);
REM INSERTING into CASEWORKER
SET DEFINE OFF;
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2000,'Julia',null,'Childs','4000 Broadway','New York','NY','F','212-555-1212','1002','Medicaid');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2020,'Arden','T','McKinney','3539 Formula Lane','Dallas','Texas','M','469-87-2001','75201','Medicaid');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2021,'Cindy','F','Melvin','201 Benedum Drive ','Goshen','New York','F','845-291-7664','10924','Community Choice');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2022,'Stephanie','A','Doiron','3103 Pineview Drive','Hartland','Minnesota','F','507-845-0990','56042','Medicare');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2023,'Austin','J','Clarke','2243 Oak Street','Syracuse','New York','M','315-611-1124','13202','Community Choice');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2024,'Yuan',null,'KO','4104 Fairfax Drive','Springs Mills','New Jersey','M','908-752-3333','08848','Community Choice');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2025,'Lin Yao',null,'Tseng','566 Johnston Street','Lansing','Michigan','F','517-763-9916','48933','Medicare');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2026,'Rosina','N','Morretti','761 Central Avenue','Secaucus','New Jersey','F','201-353-6553','07094','Medicaid');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2027,'Marcus','D','Borg','4421 Charla Lane','Houston','Texas','M','972-431-4321','75287','Older Adult');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2028,'Janet','B','Hamilton','8851 Radio Park Drive','Franklin','Georgia','F','706-003-1998','30217','Older Adult');
Insert into CASEWORKER (CASEWORKERID,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,SEX,PHONE,ZIPCODE,NAMEOFINSURER) values (2029,'Jolie','H','Perez','2078 Pointe Lane','Hollywood','Florida','F','954-921-7665','33020','Community Choice');
REM INSERTING into CLIENT
SET DEFINE OFF;
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('111223333','Brian','x','McWhomever','100 Disabled Alley','Baltimore','MD','410-555-1235',' ','brian@mcwhomever.com','21214');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('123456789','Sam','E','Johnson','456 Dirty Rock Road','Newark','Delaware','302-098-7895','M','sam.johnson@aol.com','19702');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('980980980','Roberta','K','Williams','4590 Golden Gate Way','Columbia','Maryland','443-111-2233','F','roberta1995@yahoo.com','20098');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('333224444','Gloria','M','Rice','921 Marigold Lane','Miami','Florida','954-008-1102','F','gloria.rice21@hotmail.com','90002');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('453453453','Anez','L','Golden','602 Holland Road','Perrington','Virginia','703-224-8790','M','golden67@aol.com','39087');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('221081207','Hillary','H','Matthews','12 Dragon Hill','Dover','Delaware','302-898-9090','F','hillary_matthews@yahoo.com','19702');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('900700500','Florence','K','Washington','76 Movie Side Way','Baltimore','Maryland','443-101-9987','F','jwashington@msn.com','21210');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('876345102','Beatrice','M','Doe','16 Hamill Way','Baltimore','Maryland','410-443-7654','F','b.m.doe@aol.com','21087');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('555009999','Marie','B','Cooper','98 Vincent Lane','Silver Spring','Maryland','301-786-0909','F','mbcooper@espn.com','26590');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('540987612','Tracey','C','Jackson','1345 York Road','Towson','Maryland','410-876-9098','F','tracey1974@towson.edu','21252');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('444332222','Doug','F','Dennis','2 Parkway Road','Windsor Mills','Maryland','443-999-4321','M','ddennis@aol.com','23451');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('777889999','Gladys',null,'Smith','400 Avenue B','New York','NY','718-555-1212',null,null,'10010');
Insert into CLIENT (CLIENTSSN,FIRSTNAME,MIDDLEINIT,LASTNAME,STREET,CITY,STATE,PHONE,SEX,EMAIL,ZIPCODE) values ('987654321','Dan','P','Engle','300 Exeter','Baltimore','MD',null,'M',null,'21202');
REM INSERTING into CLIENTCONTACT
SET DEFINE OFF;
REM INSERTING into CREDENTIAL
SET DEFINE OFF;
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Driver License');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('GNA');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Passport');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Physician Assistant');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Register Nurse License');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Social Security Card');
Insert into CREDENTIAL (CREDENTIALTYPE) values ('Student ID');
REM INSERTING into INSURANCE
SET DEFINE OFF;
Insert into INSURANCE (NAMEOFINSURER) values ('Medicaid');
Insert into INSURANCE (NAMEOFINSURER) values ('Community Choice');
Insert into INSURANCE (NAMEOFINSURER) values ('Medicare');
Insert into INSURANCE (NAMEOFINSURER) values ('Older Adult');
REM INSERTING into INSURED
SET DEFINE OFF;
Insert into INSURED (CLIENTSSN,CASEWORKERID,INSURANCENUMBER,ISPRIMARY,HOURLYBILLRATE) values ('111223333',2000,'876543543','Y',100);
Insert into INSURED (CLIENTSSN,CASEWORKERID,INSURANCENUMBER,ISPRIMARY,HOURLYBILLRATE) values ('980980980',2000,'786534','Y',75.69);
Insert into INSURED (CLIENTSSN,CASEWORKERID,INSURANCENUMBER,ISPRIMARY,HOURLYBILLRATE) values ('123456789',2021,'841738','N',58.95);
Insert into INSURED (CLIENTSSN,CASEWORKERID,INSURANCENUMBER,ISPRIMARY,HOURLYBILLRATE) values ('444332222',2021,'766790','Y',88.65);
Insert into INSURED (CLIENTSSN,CASEWORKERID,INSURANCENUMBER,ISPRIMARY,HOURLYBILLRATE) values ('111223333',2021,'50000000ABC','N',50);
REM INSERTING into INVOICE
SET DEFINE OFF;
Insert into INVOICE (INVOICENUMBER,DOLLARAMOUNT,INVOICEDATE,CLIENTSSN,CASEWORKERID) values (454322980,1975.25,to_date('31-JUL-10','DD-MON-RR'),'111223333',2000);
Insert into INVOICE (INVOICENUMBER,DOLLARAMOUNT,INVOICEDATE,CLIENTSSN,CASEWORKERID) values (3000,200,to_date('03-DEC-11','DD-MON-RR'),'111223333',2000);
Insert into INVOICE (INVOICENUMBER,DOLLARAMOUNT,INVOICEDATE,CLIENTSSN,CASEWORKERID) values (3020,689.95,to_date('16-OCT-11','DD-MON-RR'),'980980980',2000);
REM INSERTING into PAYMENT
SET DEFINE OFF;
Insert into PAYMENT (INVOICENUMBER,PAYMENTAMOUNT,PAYMENTDATE) values (3000,200,to_date('05-DEC-11','DD-MON-RR'));
Insert into PAYMENT (INVOICENUMBER,PAYMENTAMOUNT,PAYMENTDATE) values (3020,765.9,to_date('21-NOV-08','DD-MON-RR'));
Insert into PAYMENT (INVOICENUMBER,PAYMENTAMOUNT,PAYMENTDATE) values (3020,1965.08,to_date('19-JUL-10','DD-MON-RR'));
REM INSERTING into SCHEDULEDVISIT
SET DEFINE OFF;
Insert into SCHEDULEDVISIT (CLIENTSSN,DATEOFVISIT,CAREGIVERID,TYPEOFCARE,TIMESTARTED,TIMEENDED,INVOICENUMBER) values ('111223333',to_date('10-DEC-11','DD-MON-RR'),1000,'Physical Therapy',null,null,null);
Insert into SCHEDULEDVISIT (CLIENTSSN,DATEOFVISIT,CAREGIVERID,TYPEOFCARE,TIMESTARTED,TIMEENDED,INVOICENUMBER) values ('111223333',to_date('12-OCT-11','DD-MON-RR'),1000,'Physical Therapy',null,null,null);
Insert into SCHEDULEDVISIT (CLIENTSSN,DATEOFVISIT,CAREGIVERID,TYPEOFCARE,TIMESTARTED,TIMEENDED,INVOICENUMBER) values ('111223333',to_date('14-DEC-01','DD-MON-RR'),1048,'Sponge Bath',null,null,null);
REM INSERTING into STAFFCONTACT
SET DEFINE OFF;
Insert into STAFFCONTACT (CAREGIVERID,FIRSTNAME,LASTNAME,MIDDLEINIT,STREET,CITY,CONTACTSTATE,PHONE,SEX,ZIPCODE) values (1040,'James','Brown','V','78 Bobby Brown Lane','Harbor','Maryland',-2678,'M','21007');
Insert into STAFFCONTACT (CAREGIVERID,FIRSTNAME,LASTNAME,MIDDLEINIT,STREET,CITY,CONTACTSTATE,PHONE,SEX,ZIPCODE) values (1043,'Patience','Stevens','P','76 Rusty Rock Road','Bel Air','Maryland',-6920,'F','21389');
Insert into STAFFCONTACT (CAREGIVERID,FIRSTNAME,LASTNAME,MIDDLEINIT,STREET,CITY,CONTACTSTATE,PHONE,SEX,ZIPCODE) values (1044,'Jerome','Jackson','J','90 Carolina Fall','Bowie','Maryland',-7801,'M','21345');
REM INSERTING into STAFFCREDENTIAL
SET DEFINE OFF;
Insert into STAFFCREDENTIAL (CAREGIVERID,EXPIRATIONDATE,IDENTIFICATIONNUMBER,CREDENTIALTYPE) values (1040,to_date('21-OCT-09','DD-MON-RR'),'48214732','GNA');
Insert into STAFFCREDENTIAL (CAREGIVERID,EXPIRATIONDATE,IDENTIFICATIONNUMBER,CREDENTIALTYPE) values (1020,to_date('07-AUG-10','DD-MON-RR'),'463246','Physician Assistant');
Insert into STAFFCREDENTIAL (CAREGIVERID,EXPIRATIONDATE,IDENTIFICATIONNUMBER,CREDENTIALTYPE) values (1044,to_date('28-DEC-11','DD-MON-RR'),'472346','Driver License');
Insert into STAFFCREDENTIAL (CAREGIVERID,EXPIRATIONDATE,IDENTIFICATIONNUMBER,CREDENTIALTYPE) values (1000,to_date('06-MAY-11','DD-MON-RR'),'13842','Driver License');
--------------------------------------------------------
--  DDL for Index CAREGIVER_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "CAREGIVER_PK" ON "CAREGIVER" ("CAREGIVERID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index CASEWORKER_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "CASEWORKER_PK" ON "CASEWORKER" ("CASEWORKERID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index CLIENT_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "CLIENT_PK" ON "CLIENT" ("CLIENTSSN") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index CREDENTIAL_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "CREDENTIAL_PK" ON "CREDENTIAL" ("CREDENTIALTYPE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index INSURED_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "INSURED_PK" ON "INSURED" ("CLIENTSSN", "CASEWORKERID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index INVOICE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "INVOICE_PK" ON "INVOICE" ("INVOICENUMBER") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index SCHEDULEDVISIT_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "SCHEDULEDVISIT_PK" ON "SCHEDULEDVISIT" ("CLIENTSSN", "DATEOFVISIT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  DDL for Index TABLE1_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "TABLE1_PK" ON "INSURANCE" ("NAMEOFINSURER") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;
/
--------------------------------------------------------
--  Constraints for Table CAREGIVER
--------------------------------------------------------

  ALTER TABLE "CAREGIVER" ADD CONSTRAINT "CAREGIVER_PK" PRIMARY KEY ("CAREGIVERID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
/
--------------------------------------------------------
--  Constraints for Table CASEWORKER
--------------------------------------------------------

  ALTER TABLE "CASEWORKER" MODIFY ("CASEWORKERID" NOT NULL ENABLE);
  ALTER TABLE "CASEWORKER" ADD CONSTRAINT "CASEWORKER_PK" PRIMARY KEY ("CASEWORKERID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
/
--------------------------------------------------------
--  Constraints for Table CLIENT
--------------------------------------------------------

  ALTER TABLE "CLIENT" ADD CONSTRAINT "CLIENT_PK" PRIMARY KEY ("CLIENTSSN")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
  ALTER TABLE "CLIENT" MODIFY ("CLIENTSSN" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table CLIENTCONTACT
--------------------------------------------------------

  ALTER TABLE "CLIENTCONTACT" MODIFY ("CLIENTSSN" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table CREDENTIAL
--------------------------------------------------------

  ALTER TABLE "CREDENTIAL" MODIFY ("CREDENTIALTYPE" NOT NULL ENABLE);
  ALTER TABLE "CREDENTIAL" ADD CONSTRAINT "CREDENTIAL_PK" PRIMARY KEY ("CREDENTIALTYPE")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
/
--------------------------------------------------------
--  Constraints for Table INSURANCE
--------------------------------------------------------

  ALTER TABLE "INSURANCE" ADD CONSTRAINT "TABLE1_PK" PRIMARY KEY ("NAMEOFINSURER")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
  ALTER TABLE "INSURANCE" MODIFY ("NAMEOFINSURER" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table INSURED
--------------------------------------------------------

  ALTER TABLE "INSURED" MODIFY ("CLIENTSSN" NOT NULL ENABLE);
  ALTER TABLE "INSURED" MODIFY ("CASEWORKERID" NOT NULL ENABLE);
  ALTER TABLE "INSURED" ADD CONSTRAINT "INSURED_PK" PRIMARY KEY ("CLIENTSSN", "CASEWORKERID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
/
--------------------------------------------------------
--  Constraints for Table INVOICE
--------------------------------------------------------

  ALTER TABLE "INVOICE" MODIFY ("CASEWORKERID" NOT NULL ENABLE);
  ALTER TABLE "INVOICE" MODIFY ("CLIENTSSN" NOT NULL ENABLE);
  ALTER TABLE "INVOICE" ADD CONSTRAINT "INVOICE_PK" PRIMARY KEY ("INVOICENUMBER")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
  ALTER TABLE "INVOICE" MODIFY ("INVOICENUMBER" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table PAYMENT
--------------------------------------------------------

  ALTER TABLE "PAYMENT" MODIFY ("INVOICENUMBER" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table SCHEDULEDVISIT
--------------------------------------------------------

  ALTER TABLE "SCHEDULEDVISIT" MODIFY ("CAREGIVERID" NOT NULL ENABLE);
  ALTER TABLE "SCHEDULEDVISIT" MODIFY ("CLIENTSSN" NOT NULL ENABLE);
  ALTER TABLE "SCHEDULEDVISIT" MODIFY ("DATEOFVISIT" NOT NULL ENABLE);
  ALTER TABLE "SCHEDULEDVISIT" ADD CONSTRAINT "SCHEDULEDVISIT_PK" PRIMARY KEY ("CLIENTSSN", "DATEOFVISIT")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
/
--------------------------------------------------------
--  Constraints for Table STAFFCONTACT
--------------------------------------------------------

  ALTER TABLE "STAFFCONTACT" MODIFY ("CAREGIVERID" NOT NULL ENABLE);
/
--------------------------------------------------------
--  Constraints for Table STAFFCREDENTIAL
--------------------------------------------------------

  ALTER TABLE "STAFFCREDENTIAL" MODIFY ("CREDENTIALTYPE" NOT NULL ENABLE);
  ALTER TABLE "STAFFCREDENTIAL" MODIFY ("CAREGIVERID" NOT NULL ENABLE);
/

--------------------------------------------------------
--  Ref Constraints for Table CASEWORKER
--------------------------------------------------------

  ALTER TABLE "CASEWORKER" ADD CONSTRAINT "CASEWORKER_INSURANCE_FK1" FOREIGN KEY ("NAMEOFINSURER")
	  REFERENCES "INSURANCE" ("NAMEOFINSURER") ENABLE;
/

--------------------------------------------------------
--  Ref Constraints for Table CLIENTCONTACT
--------------------------------------------------------

  ALTER TABLE "CLIENTCONTACT" ADD CONSTRAINT "CLIENTCONTACT_FK1" FOREIGN KEY ("CLIENTSSN")
	  REFERENCES "CLIENT" ("CLIENTSSN") ENABLE;
/


--------------------------------------------------------
--  Ref Constraints for Table INSURED
--------------------------------------------------------

  ALTER TABLE "INSURED" ADD CONSTRAINT "INSURED_FK1" FOREIGN KEY ("CLIENTSSN")
	  REFERENCES "CLIENT" ("CLIENTSSN") ENABLE;
  ALTER TABLE "INSURED" ADD CONSTRAINT "INSURED_FK2" FOREIGN KEY ("CASEWORKERID")
	  REFERENCES "CASEWORKER" ("CASEWORKERID") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table INVOICE
--------------------------------------------------------

  ALTER TABLE "INVOICE" ADD CONSTRAINT "INVOICE_FK1" FOREIGN KEY ("CLIENTSSN")
	  REFERENCES "CLIENT" ("CLIENTSSN") ENABLE;
  ALTER TABLE "INVOICE" ADD CONSTRAINT "INVOICE_FK2" FOREIGN KEY ("CASEWORKERID")
	  REFERENCES "CASEWORKER" ("CASEWORKERID") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table PAYMENT
--------------------------------------------------------

  ALTER TABLE "PAYMENT" ADD CONSTRAINT "PAYMENT_FK1" FOREIGN KEY ("INVOICENUMBER")
	  REFERENCES "INVOICE" ("INVOICENUMBER") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table SCHEDULEDVISIT
--------------------------------------------------------

  ALTER TABLE "SCHEDULEDVISIT" ADD CONSTRAINT "SCHEDULEDVISIT_FK1" FOREIGN KEY ("CLIENTSSN")
	  REFERENCES "CLIENT" ("CLIENTSSN") ENABLE;
  ALTER TABLE "SCHEDULEDVISIT" ADD CONSTRAINT "SCHEDULEDVISIT_FK2" FOREIGN KEY ("CAREGIVERID")
	  REFERENCES "CAREGIVER" ("CAREGIVERID") ENABLE;
  ALTER TABLE "SCHEDULEDVISIT" ADD CONSTRAINT "SCHEDULEDVISIT_INVOICE_FK1" FOREIGN KEY ("INVOICENUMBER")
	  REFERENCES "INVOICE" ("INVOICENUMBER") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table STAFFCONTACT
--------------------------------------------------------

  ALTER TABLE "STAFFCONTACT" ADD CONSTRAINT "STAFFCONTACT_FK1" FOREIGN KEY ("CAREGIVERID")
	  REFERENCES "CAREGIVER" ("CAREGIVERID") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table STAFFCREDENTIAL
--------------------------------------------------------

  ALTER TABLE "STAFFCREDENTIAL" ADD CONSTRAINT "STAFFCREDENTIAL_CAREGIVER_FK1" FOREIGN KEY ("CAREGIVERID")
	  REFERENCES "CAREGIVER" ("CAREGIVERID") ENABLE;
  ALTER TABLE "STAFFCREDENTIAL" ADD CONSTRAINT "STAFFCREDENTIAL_FK1" FOREIGN KEY ("CREDENTIALTYPE")
	  REFERENCES "CREDENTIAL" ("CREDENTIALTYPE") ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger CAREGIVER_T1
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "CAREGIVER_T1" 
BEFORE
insert on CareGiver
for each row
begin
if :NEW.careGiverId is null then 
    select CAREGIVER_SEQ1.nextval into :NEW.careGiverId from dual; 
  end if; 
end;
/
ALTER TRIGGER "CAREGIVER_T1" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger CASEWORKER_T1
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "CASEWORKER_T1" 
BEFORE
insert on CaseWorker
for each row
begin
  if :NEW.caseWorkerId is null then 
    select CASEWORKER_SEQ1.nextval into :NEW.caseWorkerId from dual; 
  end if;
end;
/
ALTER TRIGGER "CASEWORKER_T1" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger INVOICE_T1
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "INVOICE_T1" 
BEFORE
insert on Invoice
for each row
begin
  if :NEW.invoiceNumber is null then 
    select INVOICE_SEQ1.nextval into :NEW.invoiceNumber from dual; 
  end if; 
end;
/
ALTER TRIGGER "INVOICE_T1" ENABLE;
/
